package com.fanshilz.flower2025.apps.admin.sysRoute.resp;

import com.mybatisflex.annotation.RelationOneToOne;
import lombok.Data;

import java.util.List;

@Data
public class SelectTreeResp {

    private Long routeId;

    private Long value;

    private String label;

    private Long parentId;

    @RelationOneToOne(selfField = "routeId", targetTable = "sys_route_meta", targetField = "routeId")
    private RouteMeta meta;

    public void setMeta(RouteMeta meta) {
        this.meta = meta;
        setLabel(meta.getTitle());
    }

    private List<SelectTreeResp> children;

    @Data
    public static class RouteMeta {

        private Long routeId;

        private Long metaId;

        private String title;

    }

}
